#include "searchitem.h"

/* Default Constructor
 * Initialises the name to a blank string
 */
searchItem::searchItem()
{
    name = "";
}

/* Paramaterised constructor
 * Takes in a QString of the line that was read in from the file,
 * and splits it up into individual words, store in  a QStringList.
 * The first word is the actual sign language word and corresponds with both the image and video filenames.
 * The remaining words are synonyms for the sign language word.
 */
searchItem::searchItem(QString line)
{
    QStringList words = line.split(" ");
    name = words[0];
    //store image and video file names
    imageFileName.append(words[0]);
    imageFileName.append(".jpg");
    videoFileName.append(words[0]);
    videoFileName.append(".wmv");

    for(int i=1; i<words.count(); i++)
    {
        synonyms.push_back(words[i]);
    }
}

/* Get Methods
 * Returns the corresponding variable
 */
QString searchItem::getName()
{
    return name;
}
QString searchItem::getVideoFileName()
{
    return videoFileName;
}
QString searchItem::getImageFileName()
{
    return imageFileName;
}
std::vector<QString> searchItem::getSynonyms()
{
    return synonyms;
}

/* Deconstructor
 * There is nothing that needs to be deconstructed so this method is empty
 */
searchItem::~searchItem()
{

}



